﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RM2012Server.View;
using RM2012Server.Component;

namespace RM2012Server.Model
{
    public class ShowForm
    {
        #region Fields
        public static frmTables m_FrmTables = null;
        public static frmArea m_FrmArea = null;
        public static frmState m_FrmState = null;
        public static frmUserGroup m_FrmUserGroup = null;
        public static frmUsers m_FrmUser = null;
        public static frmPermission m_FrmPermission = null;
        public static frmUnit m_FrmUnit = null;
        public static frmCategory m_FrmCategory = null;
        public static frmMaterial m_FrmMaterial = null;
        public static frmServe m_FrmServe = null;
        public static frmAbout m_FrmAbout = null;
        public static frmAboutTran m_FrmAboutTran = null;
        public static frmChangePassword m_FrmChangePass = null;
        public static frmProfile m_FrmProfile = null;
        public static frmBooking m_FrmBooking = null;
        public static frmCustomer m_FrmCustomer = null;
        public static frmConnection m_FrmConnection = null;
        public static frmMenu m_FrmMenu = null;
        public static frmSupplier m_FrmSupplier = null;
        public static frmInvoice m_FrmInvoice = null;
        public static frmServe2 m_FrmServe2 = null;
        public static frmLog m_FrmLog = null;
        public static frmInventory m_FrmInventory = null;
        //Thong ke
        public static frptCustomer m_FrptCustomer = null;
        public static frptInvoice m_FrptReportInvoice = null;
        public static frmBusiness m_FrmBusiness = null;
        public static frmImportExport m_FrmImportExport = null;
        #endregion

        #region Menu Start
        public static void ShowFormChangePass()
        {
            if (m_FrmChangePass == null || m_FrmChangePass.IsDisposed)
            {
                m_FrmChangePass = new frmChangePassword();
                m_FrmChangePass.Show();
            }
            else
                m_FrmChangePass.Activate();
        }

        public static void ShowFormProfile()
        {
            if (m_FrmProfile == null || m_FrmProfile.IsDisposed)
            {
                m_FrmProfile = new frmProfile();
                m_FrmProfile.Show();
            }
            else
                m_FrmProfile.Activate();
        }
        #endregion

        #region Quan Ly
        public static void ShowFormTables()
        {
            if (m_FrmTables == null || m_FrmTables.IsDisposed)
            {
                m_FrmTables = new frmTables();
                m_FrmTables.MdiParent = frmMain.ActiveForm;
                m_FrmTables.Show();
            }
            else
                m_FrmTables.Activate();
        }

        public static void ShowFormArea()
        {
            if (m_FrmArea == null || m_FrmArea.IsDisposed)
            {
                m_FrmArea = new frmArea();
                m_FrmArea.MdiParent = frmMain.ActiveForm;
                m_FrmArea.Show();
            }
            else
                m_FrmArea.Activate();
        }

        public static void ShowFormState()
        {
            if (m_FrmState == null || m_FrmState.IsDisposed)
            {
                m_FrmState = new frmState();
                m_FrmState.MdiParent = frmMain.ActiveForm;
                m_FrmState.Show();
            }
            else
                m_FrmState.Activate();
        }

        public static void ShowFormUserGroup()
        {
            if (m_FrmUserGroup == null || m_FrmUserGroup.IsDisposed)
            {
                m_FrmUserGroup = new frmUserGroup();
                m_FrmUserGroup.MdiParent = frmMain.ActiveForm;
                m_FrmUserGroup.Show();
            }
            else
                m_FrmUserGroup.Activate();
        }

        public static void ShowFormUser()
        {
            if (m_FrmUser == null || m_FrmUser.IsDisposed)
            {
                m_FrmUser = new frmUsers();
                m_FrmUser.MdiParent = frmMain.ActiveForm;
                m_FrmUser.Show();
            }
            else
                m_FrmUser.Activate();
        }

        public static void ShowFormPermission()
        {
            if (m_FrmPermission == null || m_FrmPermission.IsDisposed)
            {
                m_FrmPermission = new frmPermission();
                m_FrmPermission.MdiParent = frmMain.ActiveForm;
                m_FrmPermission.Show();
            }
            else
                m_FrmPermission.Activate();
        }

        public static void ShowFormUnit()
        {
            if (m_FrmUnit == null || m_FrmUnit.IsDisposed)
            {
                m_FrmUnit = new frmUnit();
                m_FrmUnit.MdiParent = frmMain.ActiveForm;
                m_FrmUnit.Show();
            }
            else
                m_FrmUnit.Activate();
        }

        public static void ShowFormCategory()
        {
            if (m_FrmCategory == null || m_FrmCategory.IsDisposed)
            {
                m_FrmCategory = new frmCategory();
                m_FrmCategory.MdiParent = frmMain.ActiveForm;
                m_FrmCategory.Show();
            }
            else
                m_FrmCategory.Activate();
        }

        public static void ShowFormMaterial()
        {
            if (m_FrmMaterial == null || m_FrmMaterial.IsDisposed)
            {
                m_FrmMaterial = new frmMaterial();
                m_FrmMaterial.MdiParent = frmMain.ActiveForm;
                m_FrmMaterial.Show();
            }
            else
                m_FrmMaterial.Activate();
        }

        public static void ShowFormMenu()
        {
            if (m_FrmMenu == null || m_FrmMenu.IsDisposed)
            {
                m_FrmMenu = new frmMenu();
                m_FrmMenu.MdiParent = frmMain.ActiveForm;
                m_FrmMenu.Show();
            }
            else
                m_FrmMenu.Activate();
        }

        public static void ShowFormSupplier()
        {
            if (m_FrmSupplier == null || m_FrmSupplier.IsDisposed)
            {
                m_FrmSupplier = new frmSupplier();
                m_FrmSupplier.MdiParent = frmMain.ActiveForm;
                m_FrmSupplier.Show();
            }
            else
                m_FrmSupplier.Activate();
        }

        public static void ShowFormServe()
        {
            if (m_FrmServe == null || m_FrmServe.IsDisposed)
            {
                m_FrmServe = new frmServe();
                m_FrmServe.MdiParent = frmMain.ActiveForm;
                m_FrmServe.Show();
            }
            else
                m_FrmServe.Activate();
        }

        public static void ShowFormServe2()
        {
            if (m_FrmServe2 == null || m_FrmServe2.IsDisposed)
            {
                m_FrmServe2 = new frmServe2();
                m_FrmServe2.MdiParent = frmMain.ActiveForm;
                m_FrmServe2.Show();
            }
            else
                m_FrmServe2.Activate();
        }

        public static void ShowFormBooking()
        {
            if (m_FrmBooking == null || m_FrmBooking.IsDisposed)
            {
                m_FrmBooking = new frmBooking();
                m_FrmBooking.MdiParent = frmMain.ActiveForm;
                m_FrmBooking.Show();
            }
            else
                m_FrmBooking.Activate();
        }

        public static void ShowFormCustomer()
        {
            if (m_FrmCustomer == null || m_FrmCustomer.IsDisposed)
            {
                m_FrmCustomer = new frmCustomer();
                m_FrmCustomer.MdiParent = frmMain.ActiveForm;
                m_FrmCustomer.Show();
            }
            else
                m_FrmCustomer.Activate();
        }

        public static void ShowFormInvoice()
        {
            if (m_FrmInvoice == null || m_FrmInvoice.IsDisposed)
            {
                m_FrmInvoice = new frmInvoice();
                m_FrmInvoice.MdiParent = frmMain.ActiveForm;
                m_FrmInvoice.Show();
            }
            else
                m_FrmCustomer.Activate();
        }
        #endregion

        #region Thong ke
        public static void ShowFormCollectCustomer()
        {
            if (m_FrptCustomer == null || m_FrptCustomer.IsDisposed)
            {
                m_FrptCustomer = new frptCustomer();
                m_FrptCustomer.MdiParent = frmMain.ActiveForm;
                m_FrptCustomer.Show();
            }
            else
                m_FrptCustomer.Activate();
        }

        public static void ShowFormReportInvoice()
        {
            if (m_FrptReportInvoice == null || m_FrptReportInvoice.IsDisposed)
            {
                m_FrptReportInvoice = new frptInvoice();
                m_FrptReportInvoice.MdiParent = frmMain.ActiveForm;
                m_FrptReportInvoice.Show();
            }
            else
                m_FrptReportInvoice.Activate();
        }

        public static void ShowFormReportInvoice2()
        {
            if (m_FrptReportInvoice == null || m_FrptReportInvoice.IsDisposed)
            {
                m_FrptReportInvoice = new frptInvoice();
                m_FrptReportInvoice.ShowDialog();
            }
            else
                m_FrptReportInvoice.Activate();
        }

        public static void ShowFormLog()
        {
            if (m_FrmLog == null || m_FrmLog.IsDisposed)
            {
                m_FrmLog = new frmLog();
                m_FrmLog.MdiParent = frmMain.ActiveForm;
                m_FrmLog.Show();
            }
            else
                m_FrmLog.Activate();
        }

        public static void ShowFormInventoryType()
        {
            if (m_FrmInventory == null || m_FrmInventory.IsDisposed)
            {
                m_FrmInventory = new frmInventory();
                m_FrmInventory.MdiParent = frmMain.ActiveForm;
                m_FrmInventory.Show();
            }
            else
                m_FrmInventory.Activate();
        }

        public static void ShowFormBusiness()
        {
            if (m_FrmBusiness == null || m_FrmBusiness.IsDisposed)
            {
                m_FrmBusiness = new frmBusiness();
                m_FrmBusiness.MdiParent = frmMain.ActiveForm;
                m_FrmBusiness.Show();
            }
            else
                m_FrmInventory.Activate();
        }

        public static void ShowFormImportExport()
        {
            if (m_FrmImportExport == null || m_FrmImportExport.IsDisposed)
            {
                m_FrmImportExport = new frmImportExport();
                m_FrmImportExport.MdiParent = frmMain.ActiveForm;
                m_FrmImportExport.Show();
            }
            else
                m_FrmImportExport.Activate();
        }
        #endregion

        #region Tra cuu
        #endregion

        #region Quy dinh
        public static void ShowFormConnection()
        {
            if (m_FrmConnection == null || m_FrmConnection.IsDisposed)
            {
                m_FrmConnection = new frmConnection();
                m_FrmConnection.Show();
            }
            else
                m_FrmConnection.Activate();
        }
        #endregion

        #region Tro giup
        public static void ShowFormAbout()
        {
            if (m_FrmAbout == null || m_FrmAbout.IsDisposed)
            {
                m_FrmAbout = new frmAbout();
                m_FrmAbout.Show();
            }
            else
                m_FrmAbout.Activate();
        }

        public static void ShowFormAboutTran()
        {
            if (m_FrmAboutTran == null || m_FrmAboutTran.IsDisposed)
            {
                m_FrmAboutTran = new frmAboutTran();
                m_FrmAboutTran.Show();
            }
            else
                m_FrmAboutTran.Activate();
        }

        public static void ShowFormHelp()
        {
            
        }
        #endregion
    }
}
